package reco.frame.demo.adapter;

import reco.frame.demo.R;
import reco.frame.tv.view.component.TvBaseAdapter;
import android.R.color;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

public class TvWidgetAdapter extends TvBaseAdapter {

	
	String[] widgetArray={"TvRelativeLayoutAsGroup选中放大容器示例"
			,"TvRelativeLayoutAsScroll自适应水平滚动容器示例"
			,"TvListView简单示例"
			,"TvGallery横向中心选中列表示例"
			,"TvGridView简单示例"
			,"TvHorizontalGridView简单示例"
			,"TvTabHost自带标题栏的fragment翻页容器综合示例 PS:可以实现VST及电视猫超屏+多屏滚动效果"
			,"TvMarqueeText无需焦点的跑马灯文字示例"
			};
	private LayoutInflater inflater;
	private Context context;
	
	public TvWidgetAdapter(Context context){
		this.inflater=LayoutInflater.from(context);
		this.context=context;
	}
	
	@Override
	public int getCount() {
		return widgetArray.length;
	}

	@Override
	public Object getItem(int position) {
		return widgetArray[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View contentView, ViewGroup parent) {
		
		Button bt=(Button) inflater.inflate(R.layout.item_widget, null);
		bt.setText(widgetArray[position]);
		return bt;
	}
}
